import queue
from PyQt5.QtCore import QThread
from PyQt5.Qt import QMutex

mutex = QMutex()


class TaskManager(QThread):
    def __init__(self, frida_manager=None):
        super(TaskManager, self).__init__()
        self.queue = queue.Queue()

    def add_task(self, task):
        self.queue.put(task)

    def run(self):
        mutex.lock()
        while True:
            try:
                str = self.queue.get(block=True, timeout=10)
                print(str)
            except Exception as e:
                print(e)
            print("fds")
        mutex.unlock()




